package com.jukte.recipe;

import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.annotation.TargetApi;
import android.content.Intent;
import android.view.View;
import android.webkit.WebView;
import com.ewhat.recipes.R;

public class QuinoaNutritionActivity extends BaseActivity{
	private WebView lWebView, webView; 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_quinoa_nutrition);
		init();

		lWebView= (WebView)findViewById(R.id.webview);
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
            // only for gingerbread and newer versions
        	setLayerTypeToWebview();
        }
        lWebView.setBackgroundColor(0x00000000);
        lWebView.loadUrl("file:///android_res/raw/nutrition.html");
        
        webView = (WebView)findViewById(R.id.adWebView);
        webView.setBackgroundColor(0x00000000);
        webView.loadUrl("file:///android_res/raw/adweb3.html");
	}

	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	private void setLayerTypeToWebview() {
		// TODO Auto-generated method stub
		lWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	}
	
	@Override
	public void init() {
		// TODO Auto-generated method stub
		super.init();
		tv_title.setText("Quinoa Nutrition");
	}
	
	public void onAdWebClick(View v){
		Uri uri = Uri.parse("http://tgpcis5.felicitygf.hop.clickbank.net");
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
		startActivity(intent);
	}
}
